import axios from 'axios';

const amapKey = '3c0c86fc7dd5acfbc27c06df21d386d0';
export const fetchSearchAddress = (keyWord: any, region?: any) => {
  return axios
    .get('https://restapi.amap.com/v5/place/text', {
      params: {keywords: keyWord, region: region, key: amapKey},
    })
    .catch(err => {
      console.error(err);
    });
};
